package com.mida.dms.knw.api;

import com.mida.dms.knw.entity.KnwConceptualDetail;
import com.mida.dms.knw.entity.vo.BodyTreeVo;
import com.mida.dms.knw.entity.vo.KnwIndividualSoltVos;
import com.mida.dms.knw.entity.vo.KnwNoumenonVo;
import com.mida.dms.knw.entity.vo.KnwSlotVo;
import com.mida.dms.knw.vo.*;
import com.mida.tool.common.result.ListResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.DependsOn;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * 写报告用Api
 */
@DependsOn("loadFromDatabasePropertyConfig")
@FeignClient(name = "KnwReportApi", url = "dms.knw.feign.url")
//@FeignClient(name = "KnwReportApi", url = "${dms.knw.feign.url}")
public interface KnwReportApi {

    /**
     * 1.查询所有本体
     */
    @GetMapping(value = "/knwReport/findAllNoumenon" ,consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult<List<KnwNoumenonVo>> findAll(@RequestBody String search);

    /**
     * 2.分页查询本体
     */
    @PostMapping(value = "/knwReport/findPage",consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult<PageResultVo<KnwNoumenonVo>> findPage(@RequestBody KnwNoumenonPageVo vo);

    /**
     * 3.根据本体soid查询所有本体Slot
     */
    @GetMapping(value = "/knwReport/findAllSlot" ,consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult<List<KnwSlotVo>> findAllSoltBynoumenonSoid(@RequestBody Long noumenonSoid);

    /**
     * 4.根据本体soid分页查询slot
     */
    @PostMapping(value = "/knwReport/selectSlot",consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult<PageResultVo<KnwSlotVo>> findPageSlotBynoumenonSoid(@RequestBody KnwSlotPageVo vo);

    /**
     * 5.根据本体soid获取本体
     * @param soid
     * @return
     */
    @GetMapping(value = "/knwReport/getKnwNoumenon" ,consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult<KnwNoumenonVo> get(@RequestBody Long soid);

    /**
     * 6.根据slotSoid查询slot
     * @param soid
     * @return
     */
    @GetMapping(value = "/knwReport/getSlotBySlotSoid" ,consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult<KnwSlotVo> findSlotBySlotSoid(@RequestBody Long soid);

    /**
     * 查询标准、精准片段
     */
    @PostMapping(value = "/knwReport/getKnwNoumenonVoList",consumes = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    ListResult<List<KnwNoumenonVo>> getKnwNoumenonVoList(@RequestBody KnwNoumenonPageVo vo);

    /**
     * 人体树根节点获取
     */
    @PostMapping(value = "/knwReport/getBodyRootNode",consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult<List<BodyTreeVo>> getBodyRootNode(@RequestBody BodyTreeParameterVo vo);

    /**
     * 人体树根节点获取
     */
    @PostMapping(value = "/knwReport/getBodyNodes",consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult<List<BodyTreeVo>> getBodyNodes(@RequestBody BodyTreeParameterVo vo);

    /**
     * getBodyMaps
     * @param vo
     * @return
     */
    @PostMapping(value = "/knwReport/getBodyMaps",consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult getBodyMaps(@RequestBody PatientInfoParameterVo vo);

    /**
     * 取得推荐诊断列表
     * @param vo
     * @return
     */
    //@PostMapping(value = "/knwReport/getRecommendDiagnosticList",consumes = {"application/json"})
    //@ResponseBody
    //ListResult getRecommendDiagnosticList(@RequestBody PatientInfoParameterVo vo);

    /**
     * 根据部位soid、检查类型soid查询相关领域本体的soid
     * @param vo
     * @return
     */
    @PostMapping(value = "/knwReport/getNoumenonDomainSoids",consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult getNoumenonDomainSoids(@RequestBody PatientInfoParameterVo vo);

    /**
     *
     * @param conceptSoids
     * @return
     */
    @PostMapping(value = "/knwReport/getKnwNoumenons",consumes = {"application/json"} , produces = {"application/json"})
    @ResponseBody
    ListResult<List<KnwNoumenonVo>> getKnwNoumenons(@RequestBody List<Long> conceptSoids);

    /**
     *
     * @param listSoid
     * @return
     */
    @PostMapping(value = "/knwReport/getBodyTree",consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult<List<BodyTreeVo>> getBodyTree(@RequestBody List<Long> listSoid);

    /**
     *
     * @param mapParm
     * @return
     */
    @PostMapping(value = "/knwReport/getKnwNoumenonList",consumes = {"application/json"}, produces = {"application/json"})
    @ResponseBody
    ListResult<List<KnwNoumenonVo>> getKnwNoumenonList(@RequestBody Map<String, Object> mapParm);

    /**
     *
     * @param mapParm
     * @return
     */
    @PostMapping(value = "/knwReport/getRecommendDiagnosticList",consumes = { "application/json" }, produces = {"application/json"})
    @ResponseBody
    ListResult<List<KnwIndividualSoltVos>> getRecommendDiagnosticList(@RequestBody Map<String, Object> mapParm);

    /**
     *
     * @param conceptSoid
     * @return
     */
    @PostMapping(value = "/knwReport/getKnwNoumenonByConceptSoid",consumes = { "application/json" }, produces = {"application/json"})
    @ResponseBody
    ListResult<KnwNoumenonVo> getKnwNoumenonByConceptSoid(@RequestBody Long conceptSoid);


    /**
     * 根据概念soid查询所有概念描述信息
     * @param conceptualSoid
     * @return
     */
    @PostMapping(value = "/knwReport/findAllByConceptSoid",consumes = { "application/json" }, produces = { "application/json;charset=UTF-8" })
    @ResponseBody
    ListResult<List<KnwConceptualDetail>> findAllByConceptSoid(@RequestBody Long conceptualSoid);

    /**
     * 根据概念描述soid查询概念描述信息
     * @param conceptualDetailSoid
     * @return
     */
    @PostMapping(value = "/knwReport/findByConceptualDetailSoid",consumes = { "application/json" },produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    ListResult<KnwConceptualDetail> findByConceptualDetailSoid(@RequestBody Long conceptualDetailSoid);

}
